Ext.define('AmpleHarvest.objects.search.querypanel.form.GeneralScareSearchForm',
{
   extend            : 'Ext.form.Panel',
   alias          : 'widget.ampleharvest-objects-search-form-generalscaresearchform',
   requires       :
   [
   
   ],
   
   title: "Search Applications",
   
   m_arr_StateEvents : [],

   constructor       : function()
   {
      
      this.items =
      [
            Ext.create("Ext.form.field.Text",
                  {
                     fieldLabel  : "General",
                     itemId      : 'f_general',
                     name     : "general",
                     hiddenName  : "general",
                     inputType   : "textfield",
                     allowBlank  : true,
                     anchor      : "100%"
                  })
      ]
   },

   load_FromJson     : function(obj_Json)
   {
      for (var int_I = 0; int_I < obj_Json.Query.length; int_I++)
      {
         if (obj_Json.Query[int_I].property == "read")
         {
            if (obj_Json.Query[int_I].condition == "!=")
            {
               this.set_FieldValue("read", "unread");
            }
            else
            {
               this.set_FieldValue("read", "read");
            }

         }
         else
         {
            var str_name = obj_Json.Query[int_I].property;
            if (obj_Json.Query[int_I].prefix)
            {
               str_name += "_"
                     + obj_Json.Query[int_I].prefix.substr(0, obj_Json.Query[int_I].prefix.length - 1);
            }

            this.set_FieldValue(str_name, obj_Json.Query[int_I].value);
         }
      }
   }
}
);